package com.ruoyi.transaction.vo;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.transaction.domain.ExpressCompany;
import com.ruoyi.transaction.domain.OrderItemTmp;
import com.ruoyi.transaction.service.impl.expressCompanyService;

import java.math.BigDecimal;
import java.util.HashMap;

public class OrderItemTmpVo extends OrderItemTmp{

    private String expressCompanyName;



    public  static OrderItemTmpVo TranFrom(OrderItemTmp OrderItemTmp){
        OrderItemTmpVo orderItemTmpVo=new OrderItemTmpVo();
        BeanUtils.copyBeanProp(orderItemTmpVo ,OrderItemTmp);
        orderItemTmpVo.getExpressCompanyName();
        expressCompanyService service =(expressCompanyService)SpringUtils.getBean("expressC");
        HashMap<Integer,ExpressCompany> map=service.mapExpressCompanys();
        orderItemTmpVo.setExpressCompanyName(map.get(OrderItemTmp.getExpressCompanyId()).getExpressCompanyName());
        return orderItemTmpVo;
    }

    public String getExpressCompanyName() {
        return expressCompanyName;
    }


    public void setExpressCompanyName(String expressCompanyName) {
        this.expressCompanyName = expressCompanyName;
    }
}